#include "stdafx.h"
#include "PatientEventHandler.h"

namespace Network
{
	PatientEventHandler::PatientEventHandler(const INET_Addr& ipAddress)
	{
		listener = new SOCK_Acceptor(ipAddress);
	}

	void PatientEventHandler::handle(unsigned char* data)
	{
		PatientEvent n_evnt = PatientEvent();

		if (0 != deserializePatientEvent((char*)data, &n_evnt)) {
			cout << "Error in deserialization of PatientEvent!";
		}
		
		cout <<"Patient id is: " << n_evnt.type  << "\n and his value is: " << n_evnt.value << "\n";
	}
}